import {
	ref
} from 'vue';
import {
	defineStore
} from 'pinia';

export const useUserStore = defineStore("userStore", () => {
	let userid = ref("");
	let token = ref("");

	const clearData = () => {
		userid.value = "";
		token.value = "";
	}

	return {
		userid,
		token,
		clearData
	}
}, {
	persist: {
		storage: {
			getItem: uni.getStorageSync,
			setItem: uni.setStorageSync
		}
	}
})